package bat.iog.hytool.tomcat.utils;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

/**
 * This class is used to obtain {@link InputStream}s for configuration files
 * from a given location String. This allows greater flexibility than these
 * files having to be loaded directly from a file system.
 */
public class ConfigFileLoader {

//    private static ConfigurationSource source;
//
//    public static final ConfigurationSource getSource() {
//        if (ConfigFileLoader.source == null) {
//            return ConfigurationSource.DEFAULT;
//        }
//        return source;
//    }
//
//    public static final void setSource(ConfigurationSource source) {
//        if (ConfigFileLoader.source == null) {
//            ConfigFileLoader.source = source;
//        }
//    }
//
//    private ConfigFileLoader() {
//        // Utility class. Hide the default constructor.
//    }
//
//
//    /**
//     * Load the resource from the specified location.
//     *
//     * @param location The location for the resource of interest. The location
//     *                 may be a URL or a file path. Relative paths will be
//     *                 resolved against CATALINA_BASE.
//     *
//     * @return The InputStream for the given resource. The caller is responsible
//     *         for closing this stream when it is no longer used.
//     *
//     * @throws IOException If an InputStream cannot be created using the
//     *                     provided location
//     */
//    @Deprecated
//    public static InputStream getInputStream(String location) throws IOException {
//        return getSource().getResource(location).getInputStream();
//    }
//
//
//    @Deprecated
//    public static URI getURI(String location) {
//        return getSource().getURI(location);
//    }

}
